import { lazy } from "react";

import MyLayout from "../layout";
import NotFound from "../views/404/404";
import Login from "../views/login";
import Menus from "../views/base/menus";
import CourseSet from "../views/course/set";
import ClassInfo from "../views/base/classInfo";
import SystemUser from "../views/base/systemUser";
import Major from "../views/base/major";
import LessonsSort from "../views/course/lessonsSort";
import Student from "../views/base/student";
import CourseSelection from "../views/course/courseSelection";
import SelectedCourses from "../views/course/selectedCourses";

const Home = lazy(() => import("../views/home"));
const Notice = lazy(() => import("../views/notice"));
const College = lazy(() => import("../views/base/college"));
const Teacher = lazy(() => import("../views/base/teacher"));
const ClassRoom = lazy(() => import("../views/base/classRoom"));
const Timer = lazy(() => import("../views/base/timer"));
const Role = lazy(() => import("../views/base/role"));


export interface RouteConfig {
  path: string;
  element?: React.ReactNode;
  auth: boolean;
  children?: RouteConfig[];
  redirect?: string
}

export const routers = [
  { path: "/login", name: "login", element: <Login />, auth: false },
  {
    path: "/",
    element: <MyLayout />,
    name: "layout",
    auth: true,
    children: [
      { path: "/home", name: 'home', element: <Home />, auth: true },
      { path: "/notice", element: <Notice />, auth: true },
      { path: "/base/college", element: <College />, auth: true, },
      { path: "/base/teacher", element: <Teacher />, auth: true },
      { path: "/base/classRoom", element: <ClassRoom />, auth: true },
      { path: "/base/timer", element: <Timer />, auth: true },
      { path: "/base/role", element: <Role />, auth: true },
      { path: "/base/menus", element: <Menus />, auth: true },
      { path: "/base/classInfo", element: <ClassInfo />, auth: true },
      { path: "/base/systemUser", element: <SystemUser />, auth: true },
      { path: "/base/major", element: <Major />, auth: true },
      { path: "/base/Student", element: <Student />, auth: true },
      { path: "/course/set", element: <CourseSet />, auth: true },
      { path: "/course/lessonsSort", element: <LessonsSort />, auth: true },
      { path: "/course/courseSelection", element: <CourseSelection />, auth: true },
      { path: "/course/selectedCourses", element: <SelectedCourses />, auth: true }

    ],
  },
  { path: "*", element: <NotFound />, auth: true },

];
